package com.scommunity.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.scommunity.domain.Feedback;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Mapper
@Repository
@Transactional(rollbackFor = Exception.class)
public interface FeedbackMapper extends BaseMapper<Feedback>{

    List<Feedback> findByCondition( @Param("fb") Feedback feedback);
    @Select("select * from sc_feedback")
    @Results({@Result(property = "ownerId" ,column = "owner_id"),
    @Result(property = "owner",column = "owner_id",one = @One(select = "com.scommunity.mapper.OwnerMapper.selectById"))}
    )
    List<Feedback> selectAll();
}
